package nsqio

import (
	"gitee.com/liukexing/mqbroker/core/typedef"
	"github.com/nsqio/go-nsq"
)

type NsqHandle struct {
	handel typedef.MessageHandle
}

//处理消息
func (c *NsqHandle) HandleMessage(msg *nsq.Message) error {
	data, ok := c.handel.Praise(msg.Body)
	if ok {
		return nil
	}
	return c.handel.Process(data)
}
